{\rtf1\ansi\ansicpg936\cocoartf1404\cocoasubrtf470
{\fonttbl\f0\fnil\fcharset0 Menlo-Regular;\f1\fnil\fcharset134 STHeitiSC-Light;}
{\colortbl;\red255\green255\blue255;\red180\green0\blue98;\red48\green111\blue121;\red77\green0\blue158;
\red29\green133\blue25;\red68\green137\blue147;\red46\green13\blue110;\red92\green38\blue153;\red110\green32\blue13;
\red100\green56\blue32;\red0\green11\blue255;\red186\green0\blue17;\red63\green105\blue30;}
\paperw11900\paperh16840\margl1440\margr1440\vieww24680\viewh11300\viewkind0
\deftab1204
\pard\tx1204\pardeftab1204\pardirnatural\partightenfactor0

\f0\fs60 \cf0 \CocoaLigature0 UIImagePickerController
\f1 \'cd\'bc\'c6\'ac\'d1\'a1\'d4\'f1\'c6\'f7\
\
\pard\tx1204\pardeftab1204\pardirnatural\partightenfactor0

\f0\fs50 \cf2 @interface\cf0  \cf3 ViewController\cf0  ()<\cf4 UINavigationControllerDelegate\cf0 ,\cf4 UIImagePickerControllerDelegate\cf0 ,\cf4 UIGestureRecognizerDelegate\cf0 >\
\{\
    \cf4 UIImagePickerController\cf0  * pickerC ;\
\}\
\cf2 @end\
\pard\tx1204\pardeftab1204\pardirnatural\partightenfactor0

\f1\fs60 \cf0 \
\pard\tx1204\pardeftab1204\pardirnatural\partightenfactor0

\f0\fs50 \cf5 //
\f1 \'b4\'b4\'bd\'a8\'b6\'d4\'cf\'f3
\f0 \cf0 \
    \cf6 pickerC\cf0  = [[\cf4 UIImagePickerController\cf0  \cf7 alloc\cf0 ] \cf7 init\cf0 ] ;\
\cf5 //
\f1 \'bd\'a8\'c1\'a2\'b4\'fa\'c0\'ed\'b9\'d8\'cf\'b5
\f0 \cf0 \
    \cf6 pickerC\cf0 .\cf8 delegate\cf0  = \cf2 self\cf0  ;\
\cf5 \
//
\f1 \'c9\'e8\'d6\'c3\'c4\'a3\'ca\'bd\'ce\'aa\'cf\'e0\'b2\'e1                                                                                                                           \
\'cd\'bc\'c6\'ac\'c0\'b4\'d7\'d4\'cf\'b5\'cd\'b3\'cf\'e0\'b2\'e1
\f0 \cf0 \
\cf6 pickerC\cf0 .\cf8 sourceType\cf0  = \cf7 UIImagePickerControllerSourceTypePhotoLibrary\cf0  ;\

\f1 \cf5 \'cd\'bc\'c6\'ac\'c0\'b4\'d7\'d4\'d5\'d5\'cf\'e0\'bb\'fa
\f0 \cf6 \
pickerC\cf0 .\cf8 sourceType\cf0  = \cf7 UIImagePickerControllerSourceTypeCamera\cf0  ;\
\
[\cf2 self\cf0  \cf7 presentViewController\cf0 :\cf6 pickerC\cf0  \cf7 animated\cf0 :\cf2 YES\cf0  \cf7 completion\cf0 :\cf2 nil\cf0 ] ;\
\
\
\pard\tx1204\pardeftab1204\pardirnatural\partightenfactor0
\cf9 #pragma mark -- UIImagePickerControllerDelegate\cf0 \
- (\cf2 void\cf0 )imagePickerController:(\cf4 UIImagePickerController\cf0  *)picker didFinishPickingImage:(\cf4 UIImage\cf0  *)image editingInfo:(\cf4 NSDictionary\cf0  *)editingInfo \cf10 NS_DEPRECATED_IOS\cf0 (\cf11 2\cf0 _0, \cf11 3\cf0 _0);\
- (\cf2 void\cf0 )imagePickerControllerDidCancel:(\cf4 UIImagePickerController\cf0  *)picker;\
\
- (\cf2 void\cf0 )imagePickerController:(\cf4 UIImagePickerController\cf0  *)picker didFinishPickingMediaWithInfo:(\cf4 NSDictionary\cf0  *)info\
\{\cf7 \
	NSLog\cf0 (\cf12 @"%@"\cf0 ,info) ;\
\
	\cf4 UIImage\cf0  * image = info[\cf12 @"UIImagePickerControllerOriginalImage"\cf0 ] ;\
\
	\cf4 UIImageView\cf0  * imageView = [[\cf4 UIImageView\cf0  \cf7 alloc\cf0 ]\cf7 initWithFrame\cf0 :\cf7 CGRectMake\cf0 (\cf11 40\cf0 , \cf11 200\cf0 , \cf11 200\cf0 , \cf11 150\cf0 )];\
    \
    imageView.\cf8 image\cf0  = image ;\
    imageView.\cf8 userInteractionEnabled\cf0  = \cf2 YES\cf0 ;\
    [\cf2 self\cf0 .\cf8 view\cf0  \cf7 addSubview\cf0 :imageView] ;\
    \
    \cf4 UILongPressGestureRecognizer\cf0  * longPress = [[\cf4 UILongPressGestureRecognizer\cf0  \cf7 alloc\cf0 ] \cf7 initWithTarget\cf0 :\cf2 self\cf0  \cf7 action\cf0 :\cf2 @selector\cf0 (pressLong:)] ;\
    longPress.\cf8 minimumPressDuration\cf0  = \cf11 0.2\cf0  ;\
    [imageView \cf7 addGestureRecognizer\cf0 :longPress] ;\
\pard\tx1204\pardeftab1204\pardirnatural\partightenfactor0

\f1 \cf13 	\'bf\'c9\'d2\'d4\'bd\'ab
\f0 imageView
\f1 \'bc\'d3\'b5\'bd\'ca\'fd\'d7\'e9\'d6\'d0\'b4\'ab\'b5\'bd\'c6\'e4\'cb\'fb\'bf\'d8\'d6\'c6\'c6\'f7
\f0 \cf0 \
    [\cf2 self\cf0  \cf7 dismissViewControllerAnimated\cf0 :\cf2 YES\cf0  \cf7 completion\cf0 :\cf2 nil\cf0 ] ;\
\}\
\
-(\cf2 void\cf0 )pressLong:(\cf4 UILongPressGestureRecognizer\cf0  *)longPress\
\{\
    [longPress.\cf8 view\cf0  \cf7 removeFromSuperview\cf0 ];\
\}\
\
}